<?php
   
    include "../conn/conn.php";
	include "../isLogin_json.php";
    $category_sql = 'SELECT * FROM tb_category  where level = 0 ';
    $result = mysqli_query($link,$category_sql);

   
     if (mysqli_num_rows($result) > 0){
  echo '{"code":0,"msg":"","data":[';
    $i=1;
    while($row = mysqli_fetch_assoc($result)) {
        $i++;
        echo json_encode($row, JSON_UNESCAPED_UNICODE);
        if($i<mysqli_num_rows($result)+1){
            echo ",";
        }

    }
    echo "]}";
}
else{
        echo '{"status":false , "data":"暂无栏目"}';
    }
mysqli_close($link);
?>